package cn.shujuhai.workflow.pluging.delagte;

import cn.shujuhai.workflow.util.EmailUtil;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

@Component
public class SendEejectionMail implements JavaDelegate {


    @Override
    public void execute(DelegateExecution execution) {
        // 获取流程变量
        String assignee = (String) execution.getVariable("assignee");
        String reason = (String) execution.getVariable("reason");
        // 使用静态工具类发送邮件
        EmailUtil.sendRejectionEmail(assignee, reason);
    }
}